<?php
error_reporting(0);
$data = json_decode(doCurlGetRequest('https://api.coinmarketcap.com/v2/ticker/?convert=cny&structure=array'));
$name = $_GET['name'];
foreach ($data->data as $key => $value) {
    # code...
    if($name == $value->symbol) {
        echo round($value->quotes->CNY->price);
    }
}
function doCurlGetRequest($url, $data = array(), $timeout = 10) {
    if($url == "" || $timeout <= 0){
        return false;
    }
    if($data != array()) {
        $url = $url . '?' . http_build_query($data);
    }
    
    $con = curl_init((string)$url);
    curl_setopt($con, CURLOPT_HEADER, false);
    curl_setopt($con, CURLOPT_RETURNTRANSFER,true);
    curl_setopt($con, CURLOPT_TIMEOUT, (int)$timeout);
    curl_setopt($con, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($con, CURLOPT_SSL_VERIFYHOST, false);
    return curl_exec($con);
}

?>